#define _CRT_SECURE_NO_WARNINGS 1
class MyQueue {
public:
    stack<int>s, c;
    /** Initialize your data structure here. */
    MyQueue() {

    }

    /** Push element x to the back of queue. */
    void push(int x) {
        s.push(x);
    }

    /** Removes the element from in front of queue and returns that element. */
    int pop() {
        while (s.size() > 1)
        {
            c.push(s.top());
            s.pop();
        }
        int t = s.top();
        s.pop();
        while (c.size())
        {
            s.push(c.top());
            c.pop();
        }
        return t;
    }

    /** Get the front element. */
    int peek() {
        while (s.size() > 1)
        {
            c.push(s.top());
            s.pop();
        }
        int t = s.top();
        while (c.size())
        {
            s.push(c.top());
            c.pop();
        }
        return t;
    }

    /** Returns whether the queue is empty. */
    bool empty() {
        return s.empty();
    }
};
